﻿using Baidu.Api.Response;
using System;
using System.Collections.Generic;
using System.Text;

namespace Baidu.Api.Request
{
    /// <summary>
    /// 分片上传—合并分片文件
    /// </summary>
    public class SuperFileCreateRequest : IBaiduRequest<SuperFileCreateResponse>
    {
        public string Path { get; set; }
        public string[] Param { get; set; }
        public string Ondup { get; set; }

        #region IBaiduRequest

        public string GetObjectName()
        {
            return "pcs/file";
        }

        public string GetMethod()
        {
            return "createsuperfile";
        }

        public IDictionary<string, string> GetFormParameters()
        {
            BaiduDictionary parameters = new BaiduDictionary();
            parameters.Add("path", this.Path);
            parameters.Add("param", Newtonsoft.Json.JsonConvert.SerializeObject(new { block_list = this.Param }));
            parameters.Add("ondup", this.Ondup);
            return parameters;
        }

        public void Validate()
        {
            //throw new NotImplementedException();
        }

        #endregion
    }
}
